package com.ftg.product.exam.mapper;

import com.diboot.core.mapper.BaseCrudMapper;
import com.ftg.product.exam.entity.SysEmpRole;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
* 员工角色中间表Mapper
* @author kangjx
* @version 1.0
* @date 2021-01-14
 * Copyright © ftg
*/
@Mapper
public interface SysEmpRoleMapper extends BaseCrudMapper<SysEmpRole> {

    @Insert("INSERT INTO sys_emp_role (roleid,empid) VALUES (10000002,#{id})")
    int saverole(Long empid);

    @Select("SELECT id FROM sys_employee ORDER BY id DESC LIMIT 0,1")
    Long selectmaxid();

    @Update("UPDATE sys_emp_role SET roleid=#{roleid} where empid = #{empid}")
    int updateforrole(Long roleid, Long empid);
}

